package cn.com.jenson.convert;

import cn.com.jenson.util.ListUtil;

import javax.persistence.AttributeConverter;
import java.util.List;


public class IntegerListConvert implements AttributeConverter<List<Integer>,String> {

    @Override
    public String convertToDatabaseColumn(List<Integer> integers) {
        return ListUtil.integerListToString(integers);
    }

    @Override
    public List<Integer> convertToEntityAttribute(String s) {
        return ListUtil.integerToIntegerList(s);
    }
}
